﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/JAFagus.Master"  AutoEventWireup="true" CodeBehind="TinTucTheoChuDe.aspx.cs" Inherits="Indeco.G24.Website.News.Admin.TinTucTheoChuDe" %>
 <%@ Register Src="~/UserControls/MenuNewsAdmin.ascx" TagName="Menu" TagPrefix="G24" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolderMain">
<script type="text/javascript">
function AddNew(key,index)
{    
    grid.AddNewRow();
}
function Edit(key,index)
{    
    grid.StartEditRow(index);
}
function Delete(key,index)
{ 
    if(confirm('Bạn muốn xóa bản ghi này ?'))         
    {   
        grid.DeleteRow(index);
    }
}
</script>
<asp:Panel ID="content" Width="100%" runat="server" Height="100%" HorizontalAlign="Center">
<div style="width:929px;padding:2,2,2,2;float:left;">
<div style="float:left;width:210px;margin-left:2px;" >
  <G24:Menu ID="menu1" runat="server" />   
</div>
<div style="float:left;width:710px;padding-left:5px;">
<table width="688px" border="0" cellpadding="0" cellspacing="0">
        <tr>
        <td class="tdBCTopLeft"></td>
        <td class="tdBCTopCenter"></td>
        <td class="tdBCTopRight"></td>
        </tr>
        <tr>
        <td class="tdBCMiddleLeft"><div class="tdBCMiddleLeft" style="visibility:hidden"></div></td>
        <td class="tdBCMiddleCenter">
	        <div class="divBCMiddleCenterHeader" >
                <div class="divBCMiddleCenterHeaderTitle" >                 
                    <span class="span-blockTitle"><asp:HyperLink ID="HyperLink2" ForeColor="#FFFFFF" CssClass="span-blockTitleTxt" runat="server">Quản lý tin tức theo chủ đề</asp:HyperLink></span>
                </div>
            </div>
            <div class="divBCMiddleCenterContent" style="width:688px;">
           <dxwgv:ASPxGridView ID="ASPxGridView3"  ClientInstanceName="grid" runat="server"
           AutoGenerateColumns="False" Width="100%" 
           CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css"
              CssPostfix="BlackGlass" OnRowDeleting="ASPxGridView3_RowDeleting"
               OnRowInserting="ASPxGridView3_RowInserting" 
               OnRowUpdating="ASPxGridView3_RowUpdating" 
               OnStartRowEditing="ASPxGridView3_StartRowEditing" OnDataBinding="ASPxGridView3_DataBinding"
            >
          <Columns> 
            <dxwgv:GridViewDataColumn Name="Delete" VisibleIndex="5">
            <EditFormSettings VisibleIndex="1" CaptionLocation="None" Visible="False" ColumnSpan="2" />
            <DataItemTemplate>           
            <a ID="A1" style="color:#3E6B96;text-decoration:none;" onclick="AddNew('<%# Container.KeyValue.ToString()%>', '<%# Container.VisibleIndex.ToString()%>')" href="#">New</a>
            <a ID="DeleteButton" style="color:#3E6B96;text-decoration:none;" onclick="Delete('<%# Container.KeyValue.ToString()%>', '<%# Container.VisibleIndex.ToString()%>')" href="#">Delete</a>            
            </DataItemTemplate>
            </dxwgv:GridViewDataColumn>           
            <dxwgv:GridViewDataTextColumn FieldName="IDTinTucChuDe" 
              Visible="false"> 
             <EditFormSettings Visible="False" />                                                          
             </dxwgv:GridViewDataTextColumn> 
              <dxwgv:GridViewDataTextColumn FieldName="IDTinTuc" 
             Visible="false"> 
             <EditFormSettings  Visible="False"  />                                                          
             </dxwgv:GridViewDataTextColumn>             
             <dxwgv:GridViewDataTextColumn FieldName="TenChuDe" 
             VisibleIndex="0" Name="Danh Muc Cha"  Caption="Ten Chu De"> 
             <EditFormSettings VisibleIndex="1" Visible="True" Caption="Ten Chu De" ColumnSpan="2" />
                <EditItemTemplate>  
                 <div id="divTen" align="left">                  
                    <dxe:ASPxComboBox ID="TenChuDe" runat="server" Value='<%#Eval("TenChuDe")%>' 
                     TextField="TenChuDe" ValueField="IDTinTucChuDe" DataSourceID="Custommize" ValueType="System.Guid"  DropDownStyle="DropDown">                     
                    </dxe:ASPxComboBox>        
                    </div>         
                   <data:TinTucChuDeDataSource ID="Custommize" SelectMethod="GetPaged" runat="server" >                     
                   </data:TinTucChuDeDataSource> 
                </EditItemTemplate>                                                   
             </dxwgv:GridViewDataTextColumn>
              <dxwgv:GridViewDataTextColumn  FieldName="TieuDe"
               VisibleIndex="1" Name="Tieu De" Caption="Tieu De Tin Tuc" >
               <EditFormSettings VisibleIndex="1" Visible="True" Caption="Tieu De Tin Tuc" ColumnSpan="2" />
                <EditItemTemplate>  
                 <div id="divTen" align="left">                  
                    <dxe:ASPxComboBox ID="TieuDe" runat="server" Value='<%#Eval("TieuDe")%>' 
                     TextField="TieuDe" ValueField="IDTinTuc" DataSourceID="Custommize" ValueType="System.Guid"  DropDownStyle="DropDown">                     
                    </dxe:ASPxComboBox>        
                    </div>         
                   <data:TinTucDataSource ID="Custommize" SelectMethod="GetPaged" runat="server" >                     
                   </data:TinTucDataSource> 
                </EditItemTemplate>                       
             </dxwgv:GridViewDataTextColumn>                                
          </Columns>
      <Settings ShowGroupPanel="False" ShowFooter="True"/>
    <Styles CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" CssPostfix="BlackGlass">
    <AlternatingRow Enabled="True"/>
        <Header ImageSpacing="5px" SortingImageSpacing="5px">
        </Header>
     </Styles>
       <SettingsEditing PopupEditFormModal="True" Mode="EditForm"  />  
         <Images ImageFolder="~/App_Themes/BlackGlass/{0}/">            
         </Images>         
    </dxwgv:ASPxGridView>
                
            </div>
        </td>
        <td class="tdBCMiddleRight"><div class="tdBCMiddleRight" style="visibility:hidden"></div></td>
        </tr>
        <tr>
        <td class="tdBCBottomLeft"></td>
        <td class="tdBCBottomCenter"></td>
        <td class="tdBCBottomRight"></td>
        </tr>
    </table> 
 <data:TinTucTheoChuDeDataSource EnableDeepLoad="true" ID="TinTucTheoChuDeDataSource" 
    SelectMethod="GetAll" runat="server"
	 InsertMethod="Insert" UpdateMethod="Update"
	 > 	 
	 <DeepLoadProperties Method="IncludeChildren"  Recursive="true">
	 <Types>	 
	 <data:TinTucTheoChuDeProperty Name="TinTuc" />
	 <data:TinTucTheoChuDeProperty Name="TinTucChuDe" />
	 </Types>
	 </DeepLoadProperties>
     </data:TinTucTheoChuDeDataSource>   
 </div>
 </div>
</asp:Panel>
</asp:Content>

